import req from "../../utils/request";
import qs from 'qs'

//资源下拉查询
export function get_getResource(query) {
  return req({
    url: "/api/getResource",
    method: "get",
    params: query,
  });
}

//获取应用详情
export function get_getAppliesInfo(query) {
  return req({
    url: "/api/getAppliesInfo",
    method: "get",
    params: query,
  });
}

//根据APPiD与函数ID查询
export function get_getAppData(query) {
  return req({
    url: "/api/getAppData",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//根据APPiD与函数ID查询
export function put_addADataInfo(query) {
  return req({
    url: "/api/addADataInfo",
    method: "put",
    data: query,
    headers: {
      'Content-Type': 'application/json'
    },
  });
}

//根据分类Id查询组件
export function get_getPluginsByPLibrary(query) {
  return req({
    url: "/api/getPluginsByPLibrary",
    method: "get",
    params: query,
  });
}

//查询通过测试组件
export function get_getPluginsByUserPass(query) {
  return req({
    url: "/api/getPluginsByUserPass",
    method: "get",
    params: query,
  });
}

//根据函数ID查询入参
export function get_getFunctionById(query) {
  return req({
    url: "/api/getFunctionById",
    method: "get",
    params: query,
  });
}

//根据应用分页，条件查询应用
export function get_getAApplication(query) {
  return req({
    url: "/api/getAApplication",
    method: "get",
    params: query,
  });
}

//根据组件，应用id查询
export function get_getARelationByAppIdAndFid(query) {
  return req({
    url: "/api/getARelationByAppIdAndFid",
    method: "get",
    params: query,
  });
}

//上传文件 获取文件地址
export function get_editPARequireFile(query) {
  return req({
    url: "/api/editPARequireFile",
    method: "post",
    params: query,
  });
}

//运行应用
export function post_appliesRun(query) {
  return req({
    url: "/api/appliesRun",
    method: "get",
    params: query
  });
}

//录入应用信息
export function put_AApplication(query) {
  return req({
    url: "/api/insertAApplication",
    method: "put",
    data: qs.stringify(query),
  });
}

//应用修改
export function put_editAApplication(query) {
  return req({
    url: "/api/editAApplication",
    method: "put",
    headers: {
      'Content-Type': 'application/json'
    },
    data: query,
  });
}

//录入应用执行计划
export function put_insertAPlan(query) {
  return req({
    url: "/api/insertAPlan",
    method: "put",
    data: qs.stringify(query),
  });
}

//录入应用附属信息
export function put_aApplicationInfoAdd(query) {
  return req({
    url: "/api/aApplicationInfoAdd",
    method: "put",
    headers: {
      'Content-Type': 'application/json'
    },
    data: query,
  });
}

//应用关系新增
export function put_insertARelation(query) {
  return req({
    url: "/api/insertARelation",
    method: "put",
    headers: {
      'Content-Type': 'application/json'
    },
    data: query,
  });
}

export function x6Add(query) {
  return req({
    url: "/api/x6Add",
    method: "get",
    // headers: {
    //   'Content-Type': 'application/json'
    // },
    // data: qs.stringify(data),
    // data: data,
    params: query
  });
}
